import {
  ColProps,
  FormInstance,
  FormProps,
  RulesProps,
} from "@arco-design/web-react";
import { FormItemEnum } from "./enums";

type FormItemType = {
  rules?: RulesProps<FormData[keyof FormData]>[];
  field?: string;
  label?: string;
  render?: () => React.ReactNode;
  initialValue?: any;
  attrs?: Record<string, any>;
  formItemAttrs?: Record<string, any>;
  colProps?: ColProps;
  el?: FormItemEnum;
  enum?: any[];
  feildNames?: {
    label: string;
    value: string;
  };
};

interface CustomFormPropsInt {
  items: FormItemType[];
  formAttrs?: FormProps;
  form?: FormInstance;
  wrap?: boolean;
  reset?: (value?: any) => void;
  showBtn?: boolean;
}

export type { FormItemType, CustomFormPropsInt };
